import request from "./request";

export class CategoryApi {
  static getAll(params): Promise<ICategory[]> {
    return request.get("/category", { params });
  }
  static add(data): Promise<ICategory> {
    return request.post("/category", data);
  }
  static update(id, data): Promise<ICategory> {
    return request.patch(`/category/${id}`, data);
  }
  static delete(id): Promise<ICategory> {
    return request.delete(`/category/${id}`);
  }
}
